package dome5;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 王圆豪
 * Date: 2024-05-30
 * Time: 21:00
 */
public class User {
    String name = "wyh";
    String password = "102";

    public String getName() {
        return name;
    }

    public String getPassword() {
        return password;
    }
    public  void logInfo(String userName, String passWord) throws NameException,
            PasswordException {
        if (!this.name.equals(userName)) {
            throw new NameException("用户名错误异常.....");
        }

        if (!this.password.equals(passWord)) {
            throw new PasswordException("密码错误异常.....");
        }
    }

}
